package com.xinkao.example.swagger.controller;

import java.util.List;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xinkao.example.domain.entity.LogEntity;


/**
 * 后台操作日志表
 * @Author 
 * @Date 2021-08-25 09:24:46
 */
@RestController
@Api(tags = "后台操作日志表")
@RequestMapping("/log/Swagger")
public class LogControllerSwagger{

    /**
     * 分页查询
     */
    @ApiOperation(value = "分页查询", response = LogPageEntity.class)
    @PostMapping("/list")
    public JSONObject list(@RequestBody LogPageParamEntity entity){
        return null;
    }
    @Data
    @ApiModel("后台操作日志表分页参数实体")
    public class LogPageParamEntity extends LogEntity{
        @ApiModelProperty("页码")
        private Integer pageNum;
        @ApiModelProperty("页数")
        private Integer pageRow;
    }
    @Data
    @ApiModel("后台操作日志表分页实体")
    public class LogPageEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private SubData data;
        @Data
        public class SubData {
            @ApiModelProperty("总条数")
            private Integer totalCount;
            @ApiModelProperty("详细数据")
            private List<LogEntity> list;
        }
    }

    /**
     * 列表查询
     */
    @ApiOperation(value = "列表查询", response = LogListEntity.class)
    @PostMapping("/listByCondition")
    public JSONObject listByCondition(@RequestBody LogEntity entity){
        return null;
    }
    @Data
    @ApiModel("后台操作日志表列表实体")
    public class LogListEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private List<LogEntity> data;
    }

    /**
     * 查询详情
     */
    @ApiOperation(value = "查询详情", response = LogInfoEntity.class)
    @PostMapping("/info/{id}")
    public JSONObject info(@PathVariable("id") String id){
        return null;
    }
    @Data
    @ApiModel("后台操作日志表详情实体")
    public class LogInfoEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private LogEntity data;
    }

    /**
     * 新增
     */
    @ApiOperation(value = "新增", response = LogComEntity.class)
    @PostMapping("/save")
    public JSONObject save(@RequestBody LogEntity entity){
        return null;
    }

    /**
     * 修改
     */
    @ApiOperation(value = "修改", response = LogComEntity.class)
    @PostMapping("/edit")
    public JSONObject edit(@RequestBody LogEntity entity){
        return null;
    }

    /**
     * 删除/批量删除
     */
    @ApiOperation(value = "删除/批量删除", response = LogComEntity.class)
    @PostMapping("/delete")
    public JSONObject delete(@RequestBody List<String> ids){
        return null;
    }
    @Data
    @ApiModel("后台操作日志表通用实体")
    public class LogComEntity{
        @ApiModelProperty("返回信息")
        private String msg;
        @ApiModelProperty("状态码")
        private String code;
        @ApiModelProperty("返回数据")
        private String data;
    }
}
